|
|
|
|
|
|
|
RDO.rdoErrors
RDO.rdoField
RDO.rdoFields
RDO.rdoQuery
RDO.rdoResultset
RDO.rdoResultsets |
|
|
|
|
|
|
|
|
The Open Database Connectivity Application Programming Interface (ODBC API) has generally been an alternative mechanism that serious Visual Basic developers use to improve upon the data access speed lacking in connecting to ODBC data sources through earlier versions of Visual Basic. The ODBC API is the most popular architecture for accessing a heterogeneous variety of database servers and runs on environments such as 16-bit Windows, 32-bit Windows 95 and Windows NT, and others. The ODBC API, always complex, has become even more so as Microsoft has addressed the growing needs of today's information storage and retrieval needs. RDO, in fact, was created as a result of developer complaints about the complexity of the ODBC API. Added to that was the headache of maintaining ODBC API code as the application evolved. Designing and implementing your own classes can encapsulate this detail, but RDO and ADO are robust enough to not justify the need to do so. Also, if you use RDO, you can pass the hDbc handle of the rdoConnection object to an ODBC API function that requires it. If you're still determined, however, to create your own raw ODBC API classes, the next section provides some assistance in how to begin designing and implementing them well. |
|
|
|
|
|
|
|
|
General ODBC API Operations Working with the ODBC API generally requires the following: |
|
|
|
|
|
|
|
|
Establishing the environment by allocating an environment handle (hEnv) using ODBC's SQLAllocEnv. |
|
|
|
|
|
|
|
|
Establishing the environment by allocating a database connection handle (hDbc) using ODBC's SQLAllocConnect. You also need a valid data source name (DSN), user ID, and password for databases that require them. |
|
|
|
|
|
|
|
|
Establishing the environment by allocating a SQL/database command statement handle (hStmt). |
|
|
|
|
|
|
|
|
Working with the actual data by binding columns, opening and closing cursors, and moving through sets of records. |
|
|
|
|
|
|
|
|
Deallocating a SQL/database command statement handle (hStmt). |
|
|
|
|
|
|
|
|
Deallocating a database connection handle (hDbc). |
|
|
|
|
|
|
|
|
Deallocating an environment handle (hEnv). |
|
|
|
|
|